package tmhm.shemes;


import java.awt.Point;
import java.util.ArrayList;

import tmhm.components.*;
import tmhm.gui.GuiLabel;
import tmhm.gui.GuiLine;
import tmhm.gui.GuiScheme;


public class Exec2 {

    private static IntToBools IBUS1bits;
    private static AND IAND1;
    private static OR IOR1;
    private static AND IAND2;
    private static OR IOR2;
    private static NOT INOT;
    private static RSFF IRSFF;
    private static AND TAND1;
    private static OR TOR1;
    private static AND TAND2;
    private static OR TOR2;
    private static NOT TNOT;
    private static RSFF TRSFF;
    private static AND NAND1;
    private static AND NAND2;
    private static OR NOR1;
    private static NOT NNOT1;
    private static AND NAND3;
    private static NOT NNOT2;
    private static AND NAND4;
    private static OR NOR2;
    private static RSFF NRSFF;
    private static AND ZAND1;
    private static AND ZAND2;
    private static OR ZOR1;
    private static NOT ZNOT1;
    private static AND ZAND3;
    private static NOT ZNOT2;
    private static AND ZAND4;
    private static OR ZOR2;
    private static RSFF ZRSFF;
    private static AND CAND1;
    private static AND CAND2;
    private static OR COR1;
    private static NOT CNOT1;
    private static AND CAND3;
    private static NOT CNOT2;
    private static AND CAND4;
    private static OR COR2;
    private static RSFF CRSFF;
    private static AND VAND1;
    private static AND VAND2;
    private static OR VOR1;
    private static NOT VNOT1;
    private static AND VAND3;
    private static NOT VNOT2;
    private static AND VAND4;
    private static OR VOR2;
    private static RSFF VRSFF;
    private static AND L0AND1;
    private static AND L0AND2;
    private static OR L0OR1;
    private static NOT L0NOT1;
    private static AND L0AND3;
    private static NOT L0NOT2;
    private static AND L0AND4;
    private static OR L0OR2;
    private static RSFF L0RSFF;
    private static AND L1AND1;
    private static AND L1AND2;
    private static OR L1OR1;
    private static NOT L1NOT1;
    private static AND L1AND3;
    private static NOT L1NOT2;
    private static AND L1AND4;
    private static OR L1OR2;
    private static RSFF L1RSFF;
    private static AND L2AND1;
    private static AND L2AND2;
    private static OR L2OR1;
    private static NOT L2NOT1;
    private static AND L2AND3;
    private static NOT L2NOT2;
    private static AND L2AND4;
    private static OR L2OR2;
    private static RSFF L2RSFF;
    private static BoolsToInt PSWH;
    private static TSB TSBPSWHout3;
    private static BoolsToInt PSWL;
    private static TSB TSBPSWLout3;
    public static RSFF STARTRSFF;
    private static GuiScheme gui;

    public static GuiScheme getGui() {
        return gui;
    }

    public static void init() {
        IBUS1bits = new IntToBools(16, 16);

        IAND1 = new AND();
        IOR1 = new OR();
        INOT = new NOT();
        IAND2 = new AND();
        IOR2 = new OR();
        IRSFF = new RSFF("I");

        TAND1 = new AND();
        TOR1 = new OR();
        TNOT = new NOT();
        TAND2 = new AND();
        TOR2 = new OR();
        TRSFF = new RSFF("T");

        NAND1 = new AND();
        NAND2 = new AND();
        NOR1 = new OR();
        NNOT1 = new NOT();
        NAND3 = new AND();
        NNOT2 = new NOT();
        NAND4 = new AND();
        NOR2 = new OR();
        NRSFF = new RSFF("N");

        ZAND1 = new AND();
        ZAND2 = new AND();
        ZOR1 = new OR();
        ZNOT1 = new NOT();
        ZAND3 = new AND();
        ZNOT2 = new NOT();
        ZAND4 = new AND();
        ZOR2 = new OR();
        ZRSFF = new RSFF("Z");

        CAND1 = new AND();
        CAND2 = new AND();
        COR1 = new OR();
        CNOT1 = new NOT();
        CAND3 = new AND();
        CNOT2 = new NOT();
        CAND4 = new AND();
        COR2 = new OR();
        CRSFF = new RSFF("C");

        VAND1 = new AND();
        VAND2 = new AND();
        VOR1 = new OR();
        VNOT1 = new NOT();
        VAND3 = new AND();
        VNOT2 = new NOT();
        VAND4 = new AND();
        VOR2 = new OR();
        VRSFF = new RSFF("V");

        L0AND1 = new AND();
        L0AND2 = new AND();
        L0OR1 = new OR();
        L0NOT1 = new NOT();
        L0AND3 = new AND();
        L0NOT2 = new NOT();
        L0AND4 = new AND();
        L0OR2 = new OR();
        L0RSFF = new RSFF("L0");

        L1AND1 = new AND();
        L1AND2 = new AND();
        L1OR1 = new OR();
        L1NOT1 = new NOT();
        L1AND3 = new AND();
        L1NOT2 = new NOT();
        L1AND4 = new AND();
        L1OR2 = new OR();
        L1RSFF = new RSFF("L1");

        L2AND1 = new AND();
        L2AND2 = new AND();
        L2OR1 = new OR();
        L2NOT1 = new NOT();
        L2AND3 = new AND();
        L2NOT2 = new NOT();
        L2AND4 = new AND();
        L2OR2 = new OR();
        L2RSFF = new RSFF("L2");

        PSWH = new BoolsToInt(8, 8);
        TSBPSWHout3 = new TSB();
        TSBPSWHout3.getOut(0).setNumOfLines(8);

        PSWL = new BoolsToInt(8, 8);
        TSBPSWLout3 = new TSB();
        TSBPSWLout3.getOut(0).setNumOfLines(8);

        STARTRSFF = new RSFF("START");
    }

    public static void connect() {
        IBUS1bits.setInputPin(0, Bus1.IBUS1());

        IAND1.setInputPin(0, Oper1.ldPSWH());
        IAND1.setInputPin(1, IBUS1bits.getOut(7));
        IOR1.setInputPin(0, Oper1.stPSWI());
        IOR1.setInputPin(1, IAND1.getOut(0));
        INOT.setInputPin(0, IBUS1bits.getOut(7));
        IAND2.setInputPin(0, Oper1.ldPSWH());
        IAND2.setInputPin(1, INOT.getOut(0));
        IOR2.setInputPin(0, IAND2.getOut(0));
        IOR2.setInputPin(1, Oper1.clPSWI());
        IRSFF.setPinE(new Pin(true));
        IRSFF.setPinClear(new Pin(false));
        IRSFF.setPinS(IOR1.getOut(0));
        IRSFF.setPinR(IOR2.getOut(0));

        TAND1.setInputPin(0, Oper1.ldPSWH());
        TAND1.setInputPin(1, IBUS1bits.getOut(6));
        TOR1.setInputPin(0, Oper1.stPSWT());
        TOR1.setInputPin(1, TAND1.getOut(0));
        TNOT.setInputPin(0, IBUS1bits.getOut(6));
        TAND2.setInputPin(0, Oper1.ldPSWH());
        TAND2.setInputPin(1, TNOT.getOut(0));
        TOR2.setInputPin(0, TAND2.getOut(0));
        TOR2.setInputPin(1, Oper1.clPSWT());
        TRSFF.setPinE(new Pin(true));
        TRSFF.setPinClear(new Pin(false));
        TRSFF.setPinS(TOR1.getOut(0));
        TRSFF.setPinR(TOR2.getOut(0));

        NAND1.setInputPin(0, Oper1.ldPSWL());
        NAND1.setInputPin(1, IBUS1bits.getOut(0));
        NAND2.setInputPin(0, Oper1.ldN());
        NAND2.setInputPin(1, Exec3.N());
        NOR1.setInputPin(0, NAND2.getOut(0));
        NOR1.setInputPin(1, NAND1.getOut(0));
        NNOT1.setInputPin(0, IBUS1bits.getOut(0));
        NAND3.setInputPin(0, Oper1.ldPSWL());
        NAND3.setInputPin(1, NNOT1.getOut(0));
        NNOT2.setInputPin(0, Exec3.N());
        NAND4.setInputPin(0, Oper1.ldN());
        NAND4.setInputPin(1, NNOT2.getOut(0));
        NOR2.setInputPin(0, NAND3.getOut(0));
        NOR2.setInputPin(1, NAND4.getOut(0));
        NRSFF.setPinE(new Pin(true));
        NRSFF.setPinClear(new Pin(false));
        NRSFF.setPinS(NOR1.getOut(0));
        NRSFF.setPinR(NOR2.getOut(0));

        ZAND1.setInputPin(0, Oper1.ldPSWL());
        ZAND1.setInputPin(1, IBUS1bits.getOut(1));
        ZAND2.setInputPin(0, Oper1.ldZ());
        ZAND2.setInputPin(1, Exec3.Z());
        ZOR1.setInputPin(0, ZAND2.getOut(0));
        ZOR1.setInputPin(1, ZAND1.getOut(0));
        ZNOT1.setInputPin(0, IBUS1bits.getOut(1));
        ZAND3.setInputPin(0, Oper1.ldPSWL());
        ZAND3.setInputPin(1, ZNOT1.getOut(0));
        ZNOT2.setInputPin(0, Exec3.Z());
        ZAND4.setInputPin(0, Oper1.ldZ());
        ZAND4.setInputPin(1, ZNOT2.getOut(0));
        ZOR2.setInputPin(0, ZAND3.getOut(0));
        ZOR2.setInputPin(1, ZAND4.getOut(0));
        ZRSFF.setPinE(new Pin(true));
        ZRSFF.setPinClear(new Pin(false));
        ZRSFF.setPinS(ZOR1.getOut(0));
        ZRSFF.setPinR(ZOR2.getOut(0));

        CAND1.setInputPin(0, Oper1.ldPSWL());
        CAND1.setInputPin(1, IBUS1bits.getOut(2));
        CAND2.setInputPin(0, Oper1.ldC());
        CAND2.setInputPin(1, Exec3.C());
        COR1.setInputPin(0, CAND2.getOut(0));
        COR1.setInputPin(1, CAND1.getOut(0));
        CNOT1.setInputPin(0, IBUS1bits.getOut(2));
        CAND3.setInputPin(0, Oper1.ldPSWL());
        CAND3.setInputPin(1, CNOT1.getOut(0));
        CNOT2.setInputPin(0, Exec3.C());
        CAND4.setInputPin(0, Oper1.ldC());
        CAND4.setInputPin(1, CNOT2.getOut(0));
        COR2.setInputPin(0, CAND3.getOut(0));
        COR2.setInputPin(1, CAND4.getOut(0));
        CRSFF.setPinE(new Pin(true));
        CRSFF.setPinClear(new Pin(false));
        CRSFF.setPinS(COR1.getOut(0));
        CRSFF.setPinR(COR2.getOut(0));

        VAND1.setInputPin(0, Oper1.ldPSWL());
        VAND1.setInputPin(1, IBUS1bits.getOut(3));
        VAND2.setInputPin(0, Oper1.ldV());
        VAND2.setInputPin(1, Exec3.V());
        VOR1.setInputPin(0, VAND2.getOut(0));
        VOR1.setInputPin(1, VAND1.getOut(0));
        VNOT1.setInputPin(0, IBUS1bits.getOut(3));
        VAND3.setInputPin(0, Oper1.ldPSWL());
        VAND3.setInputPin(1, VNOT1.getOut(0));
        VNOT2.setInputPin(0, Exec3.V());
        VAND4.setInputPin(0, Oper1.ldV());
        VAND4.setInputPin(1, VNOT2.getOut(0));
        VOR2.setInputPin(0, VAND3.getOut(0));
        VOR2.setInputPin(1, VAND4.getOut(0));
        VRSFF.setPinE(new Pin(true));
        VRSFF.setPinClear(new Pin(false));
        VRSFF.setPinS(VOR1.getOut(0));
        VRSFF.setPinR(VOR2.getOut(0));

        L0AND1.setInputPin(0, Oper1.ldPSWL());
        L0AND1.setInputPin(1, IBUS1bits.getOut(4));
        L0AND2.setInputPin(0, Oper1.ldL());
        L0AND2.setInputPin(1, Intr2.prl0());
        L0OR1.setInputPin(0, L0AND2.getOut(0));
        L0OR1.setInputPin(1, L0AND1.getOut(0));
        L0NOT1.setInputPin(0, IBUS1bits.getOut(4));
        L0AND3.setInputPin(0, Oper1.ldPSWL());
        L0AND3.setInputPin(1, L0NOT1.getOut(0));
        L0NOT2.setInputPin(0, Intr2.prl0());
        L0AND4.setInputPin(0, Oper1.ldL());
        L0AND4.setInputPin(1, L0NOT2.getOut(0));
        L0OR2.setInputPin(0, L0AND3.getOut(0));
        L0OR2.setInputPin(1, L0AND4.getOut(0));
        L0RSFF.setPinE(new Pin(true));
        L0RSFF.setPinClear(new Pin(false));
        L0RSFF.setPinS(L0OR1.getOut(0));
        L0RSFF.setPinR(L0OR2.getOut(0));

        L1AND1.setInputPin(0, Oper1.ldPSWL());
        L1AND1.setInputPin(1, IBUS1bits.getOut(5));
        L1AND2.setInputPin(0, Oper1.ldL());
        L1AND2.setInputPin(1, Intr2.prl1());
        L1OR1.setInputPin(0, L1AND2.getOut(0));
        L1OR1.setInputPin(1, L1AND1.getOut(0));
        L1NOT1.setInputPin(0, IBUS1bits.getOut(5));
        L1AND3.setInputPin(0, Oper1.ldPSWL());
        L1AND3.setInputPin(1, L1NOT1.getOut(0));
        L1NOT2.setInputPin(0, Intr2.prl1());
        L1AND4.setInputPin(0, Oper1.ldL());
        L1AND4.setInputPin(1, L1NOT2.getOut(0));
        L1OR2.setInputPin(0, L1AND3.getOut(0));
        L1OR2.setInputPin(1, L1AND4.getOut(0));
        L1RSFF.setPinE(new Pin(true));
        L1RSFF.setPinClear(new Pin(false));
        L1RSFF.setPinS(L1OR1.getOut(0));
        L1RSFF.setPinR(L1OR2.getOut(0));

        L2AND1.setInputPin(0, Oper1.ldPSWL());
        L2AND1.setInputPin(1, IBUS1bits.getOut(6));
        L2AND2.setInputPin(0, Oper1.ldL());
        L2AND2.setInputPin(1, Intr2.prl2());
        L2OR1.setInputPin(0, L2AND2.getOut(0));
        L2OR1.setInputPin(1, L2AND1.getOut(0));
        L2NOT1.setInputPin(0, IBUS1bits.getOut(6));
        L2AND3.setInputPin(0, Oper1.ldPSWL());
        L2AND3.setInputPin(1, L2NOT1.getOut(0));
        L2NOT2.setInputPin(0, Intr2.prl2());
        L2AND4.setInputPin(0, Oper1.ldL());
        L2AND4.setInputPin(1, L2NOT2.getOut(0));
        L2OR2.setInputPin(0, L2AND3.getOut(0));
        L2OR2.setInputPin(1, L2AND4.getOut(0));
        L2RSFF.setPinE(new Pin(true));
        L2RSFF.setPinClear(new Pin(false));
        L2RSFF.setPinS(L2OR1.getOut(0));
        L2RSFF.setPinR(L2OR2.getOut(0));

        for (int i = 0; i < 6; i++) {
            PSWH.setInputPin(i, new Pin(false));
        }
        PSWH.setInputPin(6, TRSFF.getOut(0));
        PSWH.setInputPin(7, IRSFF.getOut(0));
        TSBPSWHout3.setInputPin(0, PSWH.getOut(0));
        TSBPSWHout3.setCtrl(Oper1.PSWHout3());
        Bus1.addOnIBUS3(TSBPSWHout3.getOut(0));

        PSWL.setInputPin(0, NRSFF.getOut(0));
        PSWL.setInputPin(1, ZRSFF.getOut(0));
        PSWL.setInputPin(2, CRSFF.getOut(0));
        PSWL.setInputPin(3, VRSFF.getOut(0));
        PSWL.setInputPin(4, L0RSFF.getOut(0));
        PSWL.setInputPin(5, L1RSFF.getOut(0));
        PSWL.setInputPin(6, L2RSFF.getOut(0));
        PSWL.setInputPin(7, new Pin(false));
        TSBPSWLout3.setInputPin(0, PSWL.getOut(0));
        TSBPSWLout3.setCtrl(Oper1.PSWLout3());
        Bus1.addOnIBUS3(TSBPSWLout3.getOut(0));

        STARTRSFF.setInputPin(0, new Pin(false));
        STARTRSFF.setInputPin(1, Oper1.clSTART()); // izmenjeno
        //STARTRSFF.getOut(0).setBoolVal(true); 	//na pocetku setovan izlaz START na true
        //nema vise potrebe za STSTART i posebnim setovanjem izlaza RSFF
        STARTRSFF.setInit(true);

    }

    public static void gui() {
        GuiLine line; // Pomocna promenljiva
        gui = new GuiScheme("tmhm/tmhm/images/Exec2.png");

        ArrayList<ArrayList<Point>> sections;
        ArrayList<Point> points;



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(341,16));
points.add(new Point(341,729));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS1());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(323,286));
points.add(new Point(323,729));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS2());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(304,300));
points.add(new Point(304,715));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(102,16));
points.add(new Point(102,246));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS1());
gui.addLine(line);

sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(341,230));
points.add(new Point(102,230));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS1());
gui.addLine(line);



        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(152, 35));
        points.add(new Point(152, 193));
        points.add(new Point(157, 193));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(153, 65));
        points.add(new Point(157, 65));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(153, 99));
        points.add(new Point(157, 99));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(153, 159));
        points.add(new Point(157, 159));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldPSWH());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(104, 108));
        points.add(new Point(154, 108));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(146, 108));
        points.add(new Point(146, 74));
        points.add(new Point(157, 74));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(7));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(178, 69));
        points.add(new Point(222, 69));
        sections.add(points);
        line = new GuiLine(sections, IAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(218, 60));
        points.add(new Point(222, 60));
        sections.add(points);
        line = new GuiLine(sections, Oper1.stPSWI());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(240, 87));
        points.add(new Point(245, 87));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(241, 65));
        points.add(new Point(245, 65));
        sections.add(points);
        line = new GuiLine(sections, IOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(178, 104));
        points.add(new Point(222, 104));
        sections.add(points);
        line = new GuiLine(sections, IAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(218, 113));
        points.add(new Point(222, 113));
        sections.add(points);
        line = new GuiLine(sections, Oper1.clPSWI());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(241, 109));
        points.add(new Point(245, 109));
        sections.add(points);
        line = new GuiLine(sections, IOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(294, 65));
        points.add(new Point(300, 65));
        sections.add(points);
        line = new GuiLine(sections, IRSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(294, 109));
        points.add(new Point(300, 109));
        sections.add(points);
        line = new GuiLine(sections, IRSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(104, 203));
        points.add(new Point(154, 203));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(146, 202));
        points.add(new Point(146, 168));
        points.add(new Point(158, 168));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(6));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(178, 164));
        points.add(new Point(222, 164));
        sections.add(points);
        line = new GuiLine(sections, TAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(218, 154));
        points.add(new Point(223, 154));
        sections.add(points);
        line = new GuiLine(sections, Oper1.stPSWT());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(241, 159));
        points.add(new Point(245, 159));
        sections.add(points);
        line = new GuiLine(sections, TOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(240, 181));
        points.add(new Point(245, 181));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(178, 198));
        points.add(new Point(222, 198));
        sections.add(points);
        line = new GuiLine(sections, TAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(218, 208));
        points.add(new Point(222, 208));
        sections.add(points);
        line = new GuiLine(sections, Oper1.clPSWT());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(241, 203));
        points.add(new Point(245, 203));
        sections.add(points);
        line = new GuiLine(sections, TOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(294, 159));
        points.add(new Point(300, 159));
        sections.add(points);
        line = new GuiLine(sections, TRSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(294, 203));
        points.add(new Point(300, 203));
        sections.add(points);
        line = new GuiLine(sections, TRSFF.getOut(1));
        gui.addLine(line);


        
        
        
        
        
        
        
        
        
        
        

sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,302));
points.add(new Point(114,302));
sections.add(points);
line=new GuiLine(sections,IRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,316));
points.add(new Point(114,316));
sections.add(points);
line=new GuiLine(sections,TRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,330));
points.add(new Point(114,330));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,345));
points.add(new Point(114,345));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,359));
points.add(new Point(114,359));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,373));
points.add(new Point(114,373));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,388));
points.add(new Point(114,388));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,402));
points.add(new Point(114,402));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(137,351));
points.add(new Point(202,351));
sections.add(points);
line=new GuiLine(sections,PSWH.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(213,356));
points.add(new Point(213,363));
sections.add(points);
line=new GuiLine(sections,Oper1.PSWHout3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(223,351));
points.add(new Point(304,351));
sections.add(points);
line=new GuiLine(sections,TSBPSWHout3.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,436));
points.add(new Point(114,436));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(108,451));
points.add(new Point(115,451));
sections.add(points);
line=new GuiLine(sections,L2RSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,465));
points.add(new Point(115,465));
sections.add(points);
line=new GuiLine(sections,L1RSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,479));
points.add(new Point(115,479));
sections.add(points);
line=new GuiLine(sections,L0RSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,493));
points.add(new Point(115,493));
sections.add(points);
line=new GuiLine(sections,VRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,508));
points.add(new Point(115,508));
sections.add(points);
line=new GuiLine(sections,CRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,523));
points.add(new Point(115,523));
sections.add(points);
line=new GuiLine(sections,ZRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(109,537));
points.add(new Point(115,537));
sections.add(points);
line=new GuiLine(sections,NRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(137,487));
points.add(new Point(202,487));
sections.add(points);
line=new GuiLine(sections,PSWL.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(213,492));
points.add(new Point(213,497));
sections.add(points);
line=new GuiLine(sections,Oper1.PSWLout3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(223,487));
points.add(new Point(304,487));
sections.add(points);
line=new GuiLine(sections,TSBPSWLout3.getOut(0));
gui.addLine(line);




sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(128,593));
points.add(new Point(136,593));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(130,617));
points.add(new Point(136,617));
sections.add(points);
line=new GuiLine(sections,LogicalComponent.getCPUCLK());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(128,643));
points.add(new Point(136,643));
sections.add(points);
line=new GuiLine(sections,Oper1.clSTART());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(192,593));
points.add(new Point(199,593));
sections.add(points);
line=new GuiLine(sections,STARTRSFF.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(192,643));
points.add(new Point(199,643));
sections.add(points);
line=new GuiLine(sections,STARTRSFF.getOut(1));
gui.addLine(line);



        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(394, 35));
        points.add(new Point(394, 665));
        points.add(new Point(399, 665));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 35));
        points.add(new Point(394, 665));
        points.add(new Point(399, 665));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 65));
        points.add(new Point(400, 65));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 99));
        points.add(new Point(400, 99));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 159));
        points.add(new Point(400, 159));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 193));
        points.add(new Point(400, 193));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 253));
        points.add(new Point(400, 253));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 288));
        points.add(new Point(400, 288));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 347));
        points.add(new Point(400, 347));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 382));
        points.add(new Point(400, 382));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 442));
        points.add(new Point(400, 442));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 476));
        points.add(new Point(400, 476));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 536));
        points.add(new Point(399, 536));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 571));
        points.add(new Point(400, 571));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(394, 630));
        points.add(new Point(400, 630));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldPSWL());
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 52));
        points.add(new Point(438, 52));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 52));
        points.add(new Point(432, 112));
        points.add(new Point(437, 112));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldN());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(342, 109));
        points.add(new Point(397, 109));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 108));
        points.add(new Point(388, 74));
        points.add(new Point(400, 74));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 87));
        points.add(new Point(426, 87));
        points.add(new Point(426, 61));
        points.add(new Point(438, 61));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 87));
        points.add(new Point(426, 121));
        points.add(new Point(434, 121));
        sections.add(points);
        line = new GuiLine(sections, Exec3.N());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 57));
        points.add(new Point(460, 57));
        points.add(new Point(460, 60));
        points.add(new Point(465, 60));
        sections.add(points);
        line = new GuiLine(sections, NAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 69));
        points.add(new Point(465, 69));
        sections.add(points);
        line = new GuiLine(sections, NAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 65));
        points.add(new Point(488, 65));
        sections.add(points);
        line = new GuiLine(sections, NOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 87));
        points.add(new Point(487, 87));
        sections.add(points);

        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);
        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 104));
        points.add(new Point(465, 104));
        sections.add(points);
        line = new GuiLine(sections, NAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 116));
        points.add(new Point(460, 116));
        points.add(new Point(460, 113));
        points.add(new Point(465, 113));
        sections.add(points);
        line = new GuiLine(sections, NAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 109));
        points.add(new Point(488, 109));
        sections.add(points);
        line = new GuiLine(sections, NOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(537, 65));
        points.add(new Point(542, 65));
        sections.add(points);
        line = new GuiLine(sections, NRSFF.getOut(0));
        gui.addLine(line);
        
        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(537, 109));
        points.add(new Point(542, 109));
        sections.add(points);
        line = new GuiLine(sections, NRSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 146));
        points.add(new Point(438, 146));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 146));
        points.add(new Point(432, 206));
        points.add(new Point(438, 206));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldZ());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 203));
        points.add(new Point(397, 203));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 203));
        points.add(new Point(388, 168));
        points.add(new Point(400, 168));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(1));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 164));
        points.add(new Point(465, 164));
        sections.add(points);
        line = new GuiLine(sections, ZAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 151));
        points.add(new Point(460, 151));
        points.add(new Point(460, 154));
        points.add(new Point(465, 154));
        sections.add(points);
        line = new GuiLine(sections, ZAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 159));
        points.add(new Point(488, 159));
        sections.add(points);
        line = new GuiLine(sections, ZOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 181));
        points.add(new Point(488, 181));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 198));
        points.add(new Point(465, 198));
        sections.add(points);
        line = new GuiLine(sections, ZAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 181));
        points.add(new Point(426, 181));
        points.add(new Point(426, 156));
        points.add(new Point(438, 156));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 181));
        points.add(new Point(426, 215));
        points.add(new Point(434, 215));
        sections.add(points);
        line = new GuiLine(sections, Exec3.Z());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 211));
        points.add(new Point(460, 211));
        points.add(new Point(460, 208));
        points.add(new Point(465, 208));
        sections.add(points);
        line = new GuiLine(sections, ZAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 203));
        points.add(new Point(488, 203));
        sections.add(points);
        line = new GuiLine(sections, ZOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 159));
        points.add(new Point(542, 159));
        sections.add(points);
        line = new GuiLine(sections, ZRSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 203));
        points.add(new Point(542, 203));
        sections.add(points);
        line = new GuiLine(sections, ZRSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 241));
        points.add(new Point(438, 241));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 241));
        points.add(new Point(432, 300));
        points.add(new Point(438, 300));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 275));
        points.add(new Point(426, 275));
        points.add(new Point(426, 250));
        points.add(new Point(438, 250));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 275));
        points.add(new Point(426, 310));
        points.add(new Point(434, 310));
        sections.add(points);
        line = new GuiLine(sections, Exec3.C());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 297));
        points.add(new Point(388, 297));
        points.add(new Point(388, 263));
        points.add(new Point(400, 263));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 297));
        points.add(new Point(397, 297));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(2));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 245));
        points.add(new Point(460, 245));
        points.add(new Point(460, 248));
        points.add(new Point(465, 248));
        sections.add(points);
        line = new GuiLine(sections, CAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 258));
        points.add(new Point(465, 258));
        sections.add(points);
        line = new GuiLine(sections, CAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 292));
        points.add(new Point(464, 292));
        sections.add(points);
        line = new GuiLine(sections, CAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 305));
        points.add(new Point(460, 305));
        points.add(new Point(460, 302));
        points.add(new Point(465, 302));
        sections.add(points);
        line = new GuiLine(sections, CAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 253));
        points.add(new Point(488, 253));
        sections.add(points);
        line = new GuiLine(sections, COR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 275));
        points.add(new Point(488, 275));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 297));
        points.add(new Point(488, 297));
        sections.add(points);
        line = new GuiLine(sections, COR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 253));
        points.add(new Point(542, 253));
        sections.add(points);
        line = new GuiLine(sections, CRSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 297));
        points.add(new Point(542, 297));
        sections.add(points);
        line = new GuiLine(sections, CRSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 335));
        points.add(new Point(438, 335));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 335));
        points.add(new Point(432, 395));
        points.add(new Point(438, 395));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldV());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 370));
        points.add(new Point(426, 370));
        points.add(new Point(426, 344));
        points.add(new Point(438, 344));
        sections.add(points);
        line = new GuiLine(sections, Exec3.V());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(426, 370));
        points.add(new Point(426, 404));
        points.add(new Point(434, 404));
        sections.add(points);
        line = new GuiLine(sections, Exec3.V());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 392));
        points.add(new Point(397, 392));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 392));
        points.add(new Point(388, 357));
        points.add(new Point(400, 357));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(3));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 352));
        points.add(new Point(465, 352));
        sections.add(points);
        line = new GuiLine(sections, VAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 340));
        points.add(new Point(460, 340));
        points.add(new Point(460, 343));
        points.add(new Point(465, 343));
        sections.add(points);
        line = new GuiLine(sections, VAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 347));
        points.add(new Point(488, 347));
        sections.add(points);
        line = new GuiLine(sections, VOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 370));
        points.add(new Point(488, 370));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 387));
        points.add(new Point(465, 387));
        sections.add(points);
        line = new GuiLine(sections, VAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 399));
        points.add(new Point(460, 399));
        points.add(new Point(460, 396));
        points.add(new Point(465, 396));
        sections.add(points);
        line = new GuiLine(sections, VAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 392));
        points.add(new Point(488, 392));
        sections.add(points);
        line = new GuiLine(sections, VOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 347));
        points.add(new Point(542, 347));
        sections.add(points);
        line = new GuiLine(sections, VRSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 392));
        points.add(new Point(542, 392));
        sections.add(points);
        line = new GuiLine(sections, VRSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 429));
        points.add(new Point(438, 429));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 429));
        points.add(new Point(432, 678));
        points.add(new Point(438, 678));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 489));
        points.add(new Point(438, 489));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 524));
        points.add(new Point(438, 524));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 583));
        points.add(new Point(438, 583));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(432, 618));
        points.add(new Point(438, 618));
        sections.add(points);
        line = new GuiLine(sections, Oper1.ldL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 464));
        points.add(new Point(426, 464));
        points.add(new Point(426, 439));
        points.add(new Point(438, 439));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 464));
        points.add(new Point(426, 498));
        points.add(new Point(434, 498));
        sections.add(points);
        line = new GuiLine(sections, Intr2.prl0());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 486));
        points.add(new Point(397, 486));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 486));
        points.add(new Point(388, 451));
        points.add(new Point(400, 451));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(4));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 447));
        points.add(new Point(465, 447));
        sections.add(points);
        line = new GuiLine(sections, L0AND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 434));
        points.add(new Point(460, 434));
        points.add(new Point(460, 437));
        points.add(new Point(465, 437));
        sections.add(points);
        line = new GuiLine(sections, L0AND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 442));
        points.add(new Point(488, 442));
        sections.add(points);
        line = new GuiLine(sections, L0OR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 464));
        points.add(new Point(488, 464));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 481));
        points.add(new Point(465, 481));
        sections.add(points);
        line = new GuiLine(sections, L0AND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 494));
        points.add(new Point(460, 494));
        points.add(new Point(460, 491));
        points.add(new Point(465, 491));
        sections.add(points);
        line = new GuiLine(sections, L0AND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 486));
        points.add(new Point(488, 486));
        sections.add(points);
        line = new GuiLine(sections, L0OR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 442));
        points.add(new Point(542, 442));
        sections.add(points);
        line = new GuiLine(sections, L0RSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 486));
        points.add(new Point(542, 486));
        sections.add(points);
        line = new GuiLine(sections, L0RSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 558));
        points.add(new Point(426, 558));
        points.add(new Point(426, 533));
        points.add(new Point(438, 533));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 558));
        points.add(new Point(426, 593));
        points.add(new Point(434, 593));
        sections.add(points);
        line = new GuiLine(sections, Intr2.prl1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 580));
        points.add(new Point(397, 580));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 580));
        points.add(new Point(388, 546));
        points.add(new Point(400, 546));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(5));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 541));
        points.add(new Point(465, 541));
        sections.add(points);
        line = new GuiLine(sections, L1AND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 528));
        points.add(new Point(460, 528));
        points.add(new Point(460, 531));
        points.add(new Point(465, 531));
        sections.add(points);
        line = new GuiLine(sections, L1AND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 575));
        points.add(new Point(465, 575));
        sections.add(points);
        line = new GuiLine(sections, L1AND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 588));
        points.add(new Point(460, 588));
        points.add(new Point(460, 585));
        points.add(new Point(465, 585));
        sections.add(points);
        line = new GuiLine(sections, L1AND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(483, 536));
        points.add(new Point(488, 536));
        sections.add(points);
        line = new GuiLine(sections, L1OR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 558));
        points.add(new Point(488, 558));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 580));
        points.add(new Point(488, 580));
        sections.add(points);
        line = new GuiLine(sections, L1OR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 536));
        points.add(new Point(542, 536));
        sections.add(points);
        line = new GuiLine(sections, L1RSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 580));
        points.add(new Point(542, 580));
        sections.add(points);
        line = new GuiLine(sections, L1RSFF.getOut(1));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(382, 652));
        points.add(new Point(426, 652));
        points.add(new Point(426, 627));
        points.add(new Point(438, 627));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(382, 652));
        points.add(new Point(426, 652));
        points.add(new Point(426, 627));
        points.add(new Point(438, 627));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(426, 652));
        points.add(new Point(426, 687));
        points.add(new Point(434, 687));
        sections.add(points);
        line = new GuiLine(sections, Intr2.prl2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(343, 674));
        points.add(new Point(397, 674));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(388, 674));
        points.add(new Point(388, 640));
        points.add(new Point(400, 640));
        sections.add(points);
        line = new GuiLine(sections, IBUS1bits.getOut(6));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 635));
        points.add(new Point(465, 635));
        sections.add(points);
        line = new GuiLine(sections, L2AND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 623));
        points.add(new Point(460, 623));
        points.add(new Point(460, 626));
        points.add(new Point(465, 626));
        sections.add(points);
        line = new GuiLine(sections, L2AND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 630));
        points.add(new Point(488, 630));
        sections.add(points);
        line = new GuiLine(sections, L2OR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(419, 670));
        points.add(new Point(465, 670));
        sections.add(points);
        line = new GuiLine(sections, L2AND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(457, 682));
        points.add(new Point(460, 682));
        points.add(new Point(460, 679));
        points.add(new Point(465, 679));
        sections.add(points);
        line = new GuiLine(sections, L2AND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 674));
        points.add(new Point(488, 674));
        sections.add(points);
        line = new GuiLine(sections, L2OR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(482, 652));
        points.add(new Point(488, 652));
        sections.add(points);
        line = new GuiLine(sections, LogicalComponent.getCPUCLK());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 630));
        points.add(new Point(542, 630));
        sections.add(points);
        line = new GuiLine(sections, L2RSFF.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(536, 674));
        points.add(new Point(542, 674));
        sections.add(points);
        line = new GuiLine(sections, L2RSFF.getOut(1));
        gui.addLine(line);

        // LABELE:
        gui.addLabel(new GuiLabel(346, 320, Bus1.IBUS1()));
        gui.addLabel(new GuiLabel(107, 62, Bus1.IBUS1()));
        gui.addLabel(new GuiLabel(309, 24, Bus1.IBUS1()));
        gui.addLabel(new GuiLabel(327, 365, Bus1.IBUS2()));
        gui.addLabel(new GuiLabel(274, 410, Bus1.IBUS3()));
        gui.addLabel(new GuiLabel(165, 370, PSWH.getOut(0)));
        gui.addLabel(new GuiLabel(260, 370, TSBPSWHout3.getOut(0)));
        gui.addLabel(new GuiLabel(165, 506, PSWL.getOut(0)));
        gui.addLabel(new GuiLabel(260, 506, TSBPSWLout3.getOut(0)));


    }

    public static Pin PSWI() {
        return IRSFF.getOut(0);
    }

    public static Pin PSWT() {
        return TRSFF.getOut(0);
    }

    public static Pin PSWN() {
        return NRSFF.getOut(0);
    }

    public static Pin PSWZ() {
        return ZRSFF.getOut(0);
    }

    public static Pin PSWC() {
        return CRSFF.getOut(0);
    }

    public static Pin PSWV() {
        return VRSFF.getOut(0);
    }

    public static Pin PSWL0() {
        return L0RSFF.getOut(0);
    }

    public static Pin PSWL1() {
        return L1RSFF.getOut(0);
    }

    public static Pin PSWL2() {
        return L2RSFF.getOut(0);
    }

    public static Pin START() {
        return STARTRSFF.getOut(0);
    }
}
